package uk.co.benbrown.jvis.model;

public class PhaseType
{
	public static final PhaseType	RANKING		= new PhaseType( "Ranking" );
	public static final PhaseType	KNOCKOUT	= new PhaseType( "Knockout" );
	public static final PhaseType	GROUP		= new PhaseType( "Group" );

	private String					value;

	private PhaseType(String value)
	{
		this.value = value;
	}

	public String toString()
	{
		return value;
	}
	
	static public PhaseType valueOf( String value )
	{
		if ( value.equals( "Ranking" ) )
		{
			return PhaseType.RANKING;
		}
		else if ( value.equals( "Knockout" ) )
		{
			return PhaseType.KNOCKOUT;
		}
		else if ( value.equals( "Group" ) )
		{
			return PhaseType.GROUP;
		}
		else
		{
			return null;
		}
	}
}